﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using SubSonic;

public partial class webUserControl_AdminPassWD : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnSub_Click(object sender, EventArgs e)
    {
        Cookies aCookies=new Cookies();

        Query q = new Query("AdminInfo");
        q.AddWhere("id", aCookies.getCookies("cID"));
        q.AddWhere("adminpasswd", tbPassWD.Text);
        q.AddUpdateSetting("adminpasswd", tbPassWD1.Text);
        if(q.GetRecordCount()>0)
        {
            q.Execute();
            Literal1.Text = "<script language=javascript>alert('修改成功!');</script>";
        }
        else
        {
            Literal1.Text = "<script language=javascript>alert('原始密码错误!');</script>";
        }
    }
}
